package day14;

import java.util.Arrays;
import java.util.List;

/**
 * @author joker
 * @date 2022/4/24 0024 - 20:15
 */
public class Test04 {
    public static void main(String[] args) throws Exception{
        Boy boy1 = new Boy(18, "张三", "男");
        Boy boy2 = new Boy(15, "李四", "男");
        Boy boy3 = new Boy(20, "王五", "女");
        Boy boy4 = new Boy(17, "赵六", "男");
        Boy boy5 = new Boy(16, "刘七", "男");
        List<Boy> boys =  Arrays.asList(boy1, boy2, boy3, boy4, boy5);
        boys.stream().filter(b->b.getAge()>=17).forEach(System.out::println);
    }
}
